[Sweep Rules] Improve variable naming in lua/hurl/main.lua #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Feedback (click)
I created this PR to address this rule:
"Variable and function names should be meaningful and descriptive."
Description
This PR improves the variable naming in the
lua/hurl/main.lua
file of thehurl.nvim
repository. The variablehead_state
has been renamed toresponse_state
to provide a more descriptive name that accurately reflects its purpose in the code.Summary of Changes
head_state
toresponse_state
throughout thelua/hurl/main.lua
file.head_state
variable toresponse_state
.if head_state == 'body'
toif response_state == 'body'
.head_state = 'start'
toresponse_state = 'start'
.elseif head_state == 'body'
toelseif response_state == 'body'
.local key, value = string.match(line, '([%w-]+):%s*(.+)')
tolocal key, value = string.match(line, '([%w-]+):%s*(.+)')
.response.body = response.body .. line
toresponse.body = response.body .. line
.'hurl: response status ' .. response.status
to'hurl: response status ' .. response.status
.'hurl: response headers ' .. vim.inspect(response.headers)
to'hurl: response headers ' .. vim.inspect(response.headers)
.'hurl: response body ' .. response.body
to'hurl: response body ' .. response.body
.Please review and merge this PR to improve the variable naming in the
lua/hurl/main.lua
file.